/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package medicalstorebilling.install;

import java.io.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import template.order_tab;


/**
 *
 * @author ADMIN
 */
public class Install extends javax.swing.JFrame {

    private Config config;
    private Connection con;
    private order_tab ordertab;
    
    private String datasql ="INSERT INTO categories ( description, name) VALUES( '', 'urinary problems');"
+"INSERT INTO categories ( description, name) VALUES( '', 'adhd');"
+"INSERT INTO categories ( description, name) VALUES( '', 'pregnancy');"
+"INSERT INTO categories ( description, name) VALUES( '', 'medicines');"
+"INSERT INTO categories ( description, name) VALUES( '', 'smoking cessation');"
+""
+"INSERT INTO customers ( address, discount_level, name, phone) VALUES( '4198 Green AvenueHayward, CA 94545', 0, 'Eugene G. Watson', '510-782-6663');"
+"INSERT INTO customers ( address, discount_level, name, phone) VALUES( '1580 Johnny LaneMilwaukee, WI 53202', 0, 'Calvin W. Graham', '414-235-7352');"
+"INSERT INTO customers ( address, discount_level, name, phone) VALUES( '1929 Better StreetKansas City, KS 64106', 0, 'Michael L. Rafferty', '913-297-9707');"
+"INSERT INTO customers ( address, discount_level, name, phone) VALUES( '1768 Washington AvenuePhoenix, AZ 85012', 0, 'Derrick I. Mello', '602-200-8167');"
+"INSERT INTO customers ( address, discount_level, name, phone) VALUES( '475 Overlook DriveMuncie, IN 47305', 0, 'James T. Coleman', '765-287-7124');"
+"INSERT INTO customers ( address, discount_level, name, phone) VALUES( '4571 Fairmont AvenueSyracuse, MO 65354', 0, 'Stacey L. Gregor', '660-298-6834');"
+"INSERT INTO customers ( address, discount_level, name, phone) VALUES( '3795 Tyler AvenueMiami, FL 33128', 0, 'Sandra P. Glass', '305-372-3147');"
+"INSERT INTO customers ( address, discount_level, name, phone) VALUES( '4618 Andy StreetLennox, SD 57039', 0, 'Crystal D. McQueen', '605-372-6127');"
+"INSERT INTO customers ( address, discount_level, name, phone) VALUES( '4682 Charmaine LaneAmarillo, TX 79109', 0, 'Sarah G. Smith', '806-463-0169');"
+"INSERT INTO customers ( address, discount_level, name, phone) VALUES( '4212 Maryland AvenueBayou, FL 34665', 0, 'Danielle M. Nivens', '727-544-5318');"
+"INSERT INTO customers ( address, discount_level, name, phone) VALUES( '2949 Lyon AvenueBoston, MA 02110', 1, 'Diane S. Phillips', '508-967-4538');"
+"INSERT INTO customers ( address, discount_level, name, phone) VALUES( '1374 Stratford ParkMackey, IN 47654', 1, 'Amanda D. Erdmann', '812-795-4184');"
+"INSERT INTO customers ( address, discount_level, name, phone) VALUES( '4462 Hall PlaceDetroit, TX 75436', 1, 'Susan C. Jasso', '903-674-1099');"
+"INSERT INTO customers ( address, discount_level, name, phone) VALUES( '2738 Isaacs Creek RoadJacksonville, IL 62650', 1, 'Ty F. Jackson', '217-461-5367');"
+"INSERT INTO customers ( address, discount_level, name, phone) VALUES( '4236 Peaceful LaneCleveland, OH 44115', 1, 'Edward S. Sikes', '216-430-6724');"
+""
+""
+""
+"INSERT INTO distributors ( address, description, name, phone, type) VALUES( '746 Karen LanePortland, OR 97225', '', 'Carmen W. Hill', '503-203-6031', 'Dealer');"
+"INSERT INTO distributors ( address, description, name, phone, type) VALUES( '2869 Yorkshire CircleElizabeth City, NC 27909', '', 'William C. Jolley', '252-331-9834', 'Distributor');"
+"INSERT INTO distributors ( address, description, name, phone, type) VALUES( '4553 Meadowview DriveChancellor, VA 22407', '', 'Marie T. Sayles', '540-786-2116', 'Wholesale Retailer');"
+"INSERT INTO distributors ( address, description, name, phone, type) VALUES( '1735 Brown AvenueGreenville, SC 29607', '', 'Steven D. Salazar', '864-940-1121', 'Dealer');"
+"INSERT INTO distributors ( address, description, name, phone, type) VALUES( '679 Morgan StreetPensacola, FL 32505', '', 'Viola G. Wells', '850-490-2944', 'Distributor');"
+"INSERT INTO distributors ( address, description, name, phone, type) VALUES( '1361 Farland StreetMansfield, MA 02048', '', 'William H. Clark', '774-229-7139', 'Wholesale Retailer');"
+"INSERT INTO distributors ( address, description, name, phone, type) VALUES( '4356 Sugarfoot LaneLafayette, IN 47906', '', 'Danny J. Moulton', '765-496-1121', 'Dealer');"
+"INSERT INTO distributors ( address, description, name, phone, type) VALUES( '1637 Boone Crockett LaneRedmond, WA 98052', '', 'Brian L. McCarthy', '360-451-3682', 'Distributor');"
+"INSERT INTO distributors ( address, description, name, phone, type) VALUES( '2261 Orchard StreetWebster, MN 55088', '', 'Richard J. Delaune', '952-652-9903', 'Wholesale Retailer');"
+"INSERT INTO distributors ( address, description, name, phone, type) VALUES( '4499 Zappia DriveLexington, KY 40507', '', 'Jackie R. Keene', '859-377-1097', 'Dealer');"
+"INSERT INTO distributors ( address, description, name, phone, type) VALUES( '2528 Finwood RoadRed Bank, NJ 07701', '', 'Lois P. Davis', '732-429-8839', 'Distributor');"
+"INSERT INTO distributors ( address, description, name, phone, type) VALUES( '2358 Adamsville RoadLaredo, TX 78040', '', 'Patricia M. Donovan', '956-693-7305', 'Wholesale Retailer');"
+"INSERT INTO distributors ( address, description, name, phone, type) VALUES( '1092 Zappia DriveCincinnati, KY 45214', '', 'Tina B. Hernandez', '859-391-4521', 'Dealer');"
+"INSERT INTO distributors ( address, description, name, phone, type) VALUES( '4713 Kyle StreetHolbrook, NE 68948', '', 'Phillip B. Siebert', '308-493-6728', 'Distributor');"
+"INSERT INTO distributors ( address, description, name, phone, type) VALUES( '4345 Pick StreetStoneham, CO 80754', '', 'Martin K. Cole', '970-735-9257', 'Wholesale Retailer');"
+""
+""
+""
+""
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'c4ca4238', 'Main use: Diabetes insipidus . Active ingredient: Desmopressin acetate. Main use: FerringMain use: Desmospray Main use: DesmotabsMain use: Octim. 	 injection', 'ddavp injection', 60.50, 1);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'c81e728d', 'Main use: Diabetes insipidus . Active ingredient: Desmopressin acetate. Main use: FerringMain use: Desmospray Main use: DesmotabsMain use: Octim. 	 injection', 'ddavp intranasal solution', 28.00, 1);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'eccbc87e', 'Main use: Diabetes insipidus . Active ingredient: Desmopressin acetate. Main use: FerringMain use: Desmospray Main use: DesmotabsMain use: Octim. 	 injection', 'ddavp tablets', 9.00, 1);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'a87ff679', 'Main use: Bedwetting . Active ingredient: Desmopressin acetate. Main use: FerringMain use: Desmospray Main use: DesmotabsMain use: Octim. 	 injection', 'desmomelt', 71.25, 1);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'e4da3b7f', 'Main use: Diabetes insipidus . Active ingredient: Desmopressin acetate (10 micrograms per.   spray). Main use: FerringMain use: DesmoMelt Main use: Desmotabs Main use: Octim injection. 	 ', 'desmospray', 12.50, 1);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '1679091c', 'Main use: Bedwetting. Active ingredient: Desmopressin acetate. Main use: FerringMain use: DesmoMelt Main use: DesmosprayMain use: Octim. 	 injection', 'desmotabs', 40.50, 1);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '8f14e45f', 'Main use: Narcolepsy. Active ingredient: Dexamfetamine sulphate. Main use: Non-proprietary', 'dexamfetamine', 34.00, 2);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'c9f0f895', 'Main use: Enlarged prostate gland. Active ingredient: Dutasteride, tamsulosin hydrochloride. Main use: GlaxoSmithKline UK', 'combodart', 58.25, 1);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '45c48cce', 'Main use: Controlling bleeding after childbirth. Active ingredient: Ergometrine maleate. Main use: Non-proprietary. ', 'ergometrine', 19.25, 3);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'd3d94468', 'Main use: Reversal of benzodiazepine sedation. Active ingredient: Flumazenil. Main use: Roche', 'anexate', 21.00, 4);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '6512bd43', 'Main use: Termination of pregnancy. Active ingredient: Gemeprost. Main use: Sanofi-Aventis', 'gemeprost pessaries', 78.25, 3);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'c20ad4d7', 'Main use: Female infertility. Active ingredient: Follitropin alfa. Main use: Merck Serono', 'gonal f', 91.25, 3);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'c51ce410', 'Main use: Reproductive organs/pituitary function testing . Active ingredient: Gonadorelin. Main use: Intrapharm laboratories', 'hrf', 23.25, 3);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'aab32389', 'Main use: Preventing rhesus negative mothers forming antibodies against their baby. Active ingredient: Human anti-D immunoglobulin. Main use: BPL', 'd gam', 36.00, 3);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '9bf31c7f', 'Main use: Underactive thyroid gland. Active ingredient: Liothyronine sodium. Main use: Non-proprietary', 'liothyronine', 74.00, 4);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'c74d97b0', 'Main use: Female infertility. Active ingredient: Lutropin alfa. Main use: Merck Serono', 'luveris', 46.00, 3);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '70efdf2e', 'Main use: Infertility. Active ingredient: Human menopausal gonadotrophin. Main use: Ferring', 'menopur', 71.50, 3);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '6f4922f4', 'Main use: Attention deficit hyperactivity disorder (ADHD) . Active ingredient: Methylphenidate hydrochloride. Main use: Janssen-Cilag', 'concerta xl', 51.50, 2);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '1f0e3dad', 'Main use: Attention deficit hyperactivity disorder (ADHD) . Active ingredient: Methylphenidate hydrochloride. Main use: UCB Pharma', 'equasym xl', 94.25, 2);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '98f13708', 'Main use: Attention deficit hyperactivity disorder. Active ingredient: Methylphenidate hydrochloride. Main use: Flynn Pharma', 'medikinet', 84.25, 2);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '3c59dc04', 'Main use: Termination of pregnancy. Active ingredient: Mifepristone. Main use: Exelgyn Laboratories', 'mifegyne', 7.25, 3);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'b6d767d2', 'Main use: Retention of urine. Active ingredient: Bethanechol chloride. Main use: Glenwood', 'myotonine', 27.00, 1);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '37693cfc', 'Main use: Overactive thyroid gland. Active ingredient: Carbimazole. Main use: Amdipharm', 'neomercazole', 28.25, 4);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '1ff1de77', 'Main use: Aid for giving up smoking. Active ingredient: Nicotine. Main use: McNeil Products LimitedMain use: Nicorette nasal spray. Main use: Nicorette patches. Main use: Nicorette quickmistMain use: Nicotinell gum', 'nicorette gum', 88.50, 5);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '8e296a06', 'Main use: Aid for giving up smoking. Active ingredient: Nicotine. Main use: McNeil Products LimitedMain use: Nicorette nasal spray. Main use: Nicorette patches. Main use: Nicorette quickmistMain use: Nicotinell gum', 'nicorette inhalator', 95.25, 5);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '4e732ced', 'Main use: Aid for giving up smoking . Active ingredient: Nicotine. Main use: McNeil Products LimitedMain use: Nicorette nasal spray. Main use: Nicorette patches. Main use: Nicorette quickmistMain use: Nicotinell gum', 'nicorette microtab', 31.50, 5);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '02e74f10', 'Main use: Aid for giving up smoking. Active ingredient: Nicotine. Main use: McNeil Products LimitedMain use: Nicorette microtab. Main use: Nicorette patches. Main use: Nicorette quickmistMain use: Nicotinell gum', 'nicorette nasal spray', 39.50, 5);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '33e75ff0', 'Main use: Aid for giving up smoking. Active ingredient: Nicotine. Main use: McNeil Products LimitedMain use: Nicorette microtab. Main use: Nicorette nasal spray. Main use: Nicorette quickmistMain use: Nicotinell gum', 'nicorette patches', 91.50, 5);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '6ea9ab1b', 'Main use: Aid for giving up smoking. Active ingredient: Nicotine. Main use: McNeil Products LimitedMain use: Nicorette microtabMain use: Nicorette nasal sprayMain use: Nicorette patchesMain use: Nicotinell gum', 'nicorette quickmist', 62.25, 5);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '34173cb3', 'Main use: Aid for giving up smoking. Active ingredient: Nicotine. Main use: Novartis Consumer HealthMain use: Nicorette microtab. Main use: Nicorette nasal spray. Main use: Nicorette patchesMain use: Nicorette quickmist . ', 'nicotinell gum', 18.00, 5);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'c16a5320', 'Main use: Aid for giving up smoking. Active ingredient: Nicotine. Main use: Novartis Consumer HealthMain use: Nicorette microtab. Main use: Nicorette nasal spray. Main use: Nicorette patchesMain use: Nicorette quickmist', 'nicotinell lozenges', 57.50, 5);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '6364d3f0', 'Main use: Aid for giving up smoking. Active ingredient: Nicotine. Main use: Novartis Consumer HealthMain use: Nicorette microtab. Main use: Nicorette nasal spray. Main use: Nicorette patchesMain use: Nicorette quickmist', 'nicotinell patches', 16.25, 5);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '182be0c5', 'Main use: Aid for giving up smoking . Active ingredient: Nicotine. Main use: GlaxoSmithKline Consumer HealthcareMain use: Nicorette microtab. Main use: Nicorette nasal spray. Main use: Nicorette patchesMain use: Nicorette quickmist', 'niquitin gum', 18.25, 5);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'e369853d', 'Main use: Aid for giving up smoking. Active ingredient: Nicotine. Main use: GlaxoSmithKline Consumer HealthcareMain use: Nicorette microtab. Main use: Nicorette nasal spray. Main use: Nicorette patchesMain use: Nicorette quickmist', 'niquitin lozenges', 72.25, 5);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '1c383cd3', 'Main use: Aid for giving up smoking. Active ingredient: Nicotine. Main use: GlaxoSmithKline Consumer HealthMain use: Nicorette microtab. Main use: Nicorette nasal spray. Main use: Nicorette patchesMain use: Nicorette quickmist', 'niquitin patches', 65.00, 5);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '19ca14e7', 'Main use: Female infertility. Active ingredient: Ganirelix. Main use: Organon', 'orgalutran', 23.50, 3);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'a5bfc9e0', 'Main use: Female infertility. Active ingredient: Choriogonadotropin alfa. Main use: Merck Serono', 'ovitrelle', 55.00, 3);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'a5771bce', 'Main use: Female infertility. Active ingredient: Follitropin alfa, lutropin alfa. Main use: Merck Serono', 'pergoveris', 12.50, 3);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'd67d8ab4', 'Main use: Diabetes insipidus. Active ingredient: Argipressin. Main use: Goldshield', 'pitressin', 19.25, 1);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'd645920e', 'Main use: Infertility. Active ingredient: Chorionic Gonadotrophin. Main use: Organon', 'pregnyl', 56.50, 3);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '3416a75f', 'Main use: Infertility. Active ingredient: Progesterone. Main use: Merck Serono', 'crinone', 91.50, 3);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'a1d0c6e8', 'Main use: Inducing labour(childbirth). Active ingredient: Dinoprostone. Main use: Ferring', 'propess', 40.25, 3);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '17e62166', 'Main use: High thyroid levels. Active ingredient: Propylthiouracil. Main use: Non-proprietary', 'propylthiouracil', 19.25, 4);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'f7177163', 'Main use: Inducing labour(childbirth). Active ingredient: Dinoprostone. Main use: Pharmacia', 'prostin e2', 42.00, 3);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '6c8349cc', 'Main use: Female infertility. Active ingredient: Follitropin beta. Main use: Organon', 'puregon', 34.50, 3);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'd9d4f495', 'Main use: Preventing rhesus negative mothers forming antibodies against their baby. Active ingredient: Human anti-D immunoglobulin. Main use: ZLB Bioplasma UK', 'rhophylac', 75.00, 3);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '67c6a1e7', 'Main use: Attention deficit hyperactivity disorder (ADHD) . Active ingredient: Methylphenidate hydrochloride. Main use: Novartis', 'ritalin', 35.00, 2);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '642e92ef', 'Main use: Urea cycle disorders. Active ingredient: Sodium phenylbutyrate. Main use: Orphan Europe', 'ammonaps', 89.50, 4);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'f457c545', 'Main use: Attention deficit hyperactivity disorder (ADHD). Active ingredient: Atomoxetine hydrochloride. Main use: Lilly', 'strattera', 34.00, 2);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'c0c7c76d', 'Main use: Infertility, endometriosis. Active ingredient: Nafarelin acetate. Main use: Pharmacia', 'synarel', 92.50, 3);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '2838023a', 'Main use: Inducing labour(childbirth). Active ingredient: Oxytocin. Main use: Alliance', 'syntocinon', 51.00, 3);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '9a115815', 'Main use: Preventing bleeding after childbirth. Active ingredient: Ergometrine maleate, oxytocin. Main use: Alliance', 'syntometrine', 31.25, 3);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'd82c8d16', 'Main use: Enlarged prostate gland . Active ingredient: Tamsulosin hydrochloride. Main use: Boehringer Ingelheim Limited', 'flomax relief mr', 91.25, 1);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'a684ecee', 'Main use: Bleeding from the oesophagus. Active ingredient: Terlipressin. Main use: Ferring', 'glypressin', 60.50, 1);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( 'b53b3a3d', 'Main use: Underactive thyroid gland. Active ingredient: Levothyroxine sodium. Main use: Mercury Pharma', 'eltroxin', 10.25, 4);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '9f61408e', 'Main use: Incontinence. Active ingredient: Fesoterodine fumarate. Main use: Pfizer', 'toviaz', 76.00, 1);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '72b32a1f', 'Main use: Incontinence. Active ingredient: Trospium chloride. Main use: Galen', 'flotros', 16.25, 1);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '66f041e1', 'Main use: Female infertility. Active ingredient: Urofollitropin. Main use: Pharmasure', 'fostimon', 90.00, 3);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '093f65e0', 'Main use: Aid for giving up smoking. Active ingredient: Varenicline tartrate. Main use: Pfizer', 'champix', 55.25, 5);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '072b030b', 'Main use: Local anaesthesia. Active ingredient: Lidocaine hydrochloride (anaesthetic). Main use: AstraZeneca', 'xylocaine vials', 31.25, 4);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '7f39f831', 'Main use: Local anaesthesia. Active ingredient: Lidocaine hydrochloride, adrenaline. Main use: AstraZeneca', 'xylocaine with adrenaline injection', 46.25, 4);"
+"INSERT INTO medicines ( code, description, name, price, category_id) VALUES( '44f683a8', 'Main use: Aid for giving up smoking . Active ingredient: Bupropion hydrochloride. Main use: GlaxoSmithKline', 'zyban', 80.50, 5);"
+""
+""
+""
+""
+"INSERT INTO purchases ( name, time, distributor_id) VALUES( 'Purchase from William C. Jolley in 2012-08-08', '2012-08-08 00:00:00', 2);"
+"INSERT INTO purchases ( name, time, distributor_id) VALUES( 'Purchase from William C. Jolley in 2012-08-23', '2012-08-23 00:00:00', 2);"
+"INSERT INTO purchases ( name, time, distributor_id) VALUES( 'Purchase from Steven D. Salazar in 2012-07-05', '2012-07-05 00:00:00', 4);"
+"INSERT INTO purchases ( name, time, distributor_id) VALUES( 'Purchase from Viola G. Wells in 2012-07-19', '2012-07-19 00:00:00', 5);"
+"INSERT INTO purchases ( name, time, distributor_id) VALUES( 'Purchase from Viola G. Wells in 2012-08-18', '2012-08-18 00:00:00', 5);"
+"INSERT INTO purchases ( name, time, distributor_id) VALUES( 'Purchase from Danny J. Moulton in 2012-07-03', '2012-07-03 00:00:00', 7);"
+"INSERT INTO purchases ( name, time, distributor_id) VALUES( 'Purchase from Richard J. Delaune in 2012-07-30', '2012-07-30 00:00:00', 9);"
+"INSERT INTO purchases ( name, time, distributor_id) VALUES( 'Purchase from Jackie R. Keene in 2012-07-09', '2012-07-09 00:00:00', 10);"
+"INSERT INTO purchases ( name, time, distributor_id) VALUES( 'Purchase from Patricia M. Donovan in 2012-07-17', '2012-07-17 00:00:00', 12);"
+"INSERT INTO purchases ( name, time, distributor_id) VALUES( 'Purchase from Patricia M. Donovan in 2012-07-26', '2012-07-26 00:00:00', 12);"
+"INSERT INTO purchases ( name, time, distributor_id) VALUES( 'Purchase from Tina B. Hernandez in 2012-07-09', '2012-07-09 00:00:00', 13);"
+"INSERT INTO purchases ( name, time, distributor_id) VALUES( 'Purchase from Tina B. Hernandez in 2012-08-18', '2012-08-18 00:00:00', 13);"
+""
+""
+""
+""
+""
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 75, 21.00, '2013-06-29 00:00:00', 75, 10, 1);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 61, 25.00, '2013-05-13 00:00:00', 0, 52, 1);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 88, 31.60, '2013-03-19 00:00:00', 71, 27, 2);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 78, 19.95, '2013-02-08 00:00:00', 78, 10, 3);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 69, 62.60, '2013-06-20 00:00:00', 30, 11, 3);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 83, 29.92, '2013-07-23 00:00:00', 33, 26, 3);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 59, 10.63, '2012-11-16 00:00:00', 27, 38, 3);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 77, 34.21, '2013-05-05 00:00:00', 29, 42, 3);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 58, 63.75, '2012-12-09 00:00:00', 6, 46, 3);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 73, 76.08, '2012-12-19 00:00:00', 17, 48, 3);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 52, 72.00, '2012-12-09 00:00:00', 6, 58, 3);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 59, 7.65, '2013-06-25 00:00:00', 59, 3, 4);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 60, 16.36, '2012-11-17 00:00:00', 14, 9, 4);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 64, 73.00, '2013-05-14 00:00:00', 64, 12, 4);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 79, 62.90, '2013-03-07 00:00:00', 79, 15, 4);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 88, 25.43, '2012-12-11 00:00:00', 0, 23, 4);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 59, 17.10, '2013-04-17 00:00:00', 59, 30, 4);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 84, 83.25, '2013-08-12 00:00:00', 55, 50, 4);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 78, 13.81, '2013-07-24 00:00:00', 24, 57, 4);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 62, 54.45, '2012-12-10 00:00:00', 0, 1, 5);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 61, 18.29, '2013-02-19 00:00:00', 61, 9, 5);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 77, 73.00, '2013-01-02 00:00:00', 77, 12, 5);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 85, 19.76, '2013-05-22 00:00:00', 20, 13, 5);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 75, 66.60, '2013-02-15 00:00:00', 75, 15, 5);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 87, 27.00, '2013-02-21 00:00:00', 8, 22, 5);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 81, 46.00, '2012-12-30 00:00:00', 56, 31, 5);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 60, 46.60, '2012-11-24 00:00:00', 26, 8, 6);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 78, 89.54, '2013-04-20 00:00:00', 0, 19, 6);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 83, 16.36, '2013-02-12 00:00:00', 36, 39, 6);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 63, 26.56, '2013-02-17 00:00:00', 63, 60, 6);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 61, 64.40, '2013-04-14 00:00:00', 3, 62, 6);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 67, 22.95, '2013-07-07 00:00:00', 67, 22, 7);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 63, 55.00, '2013-05-13 00:00:00', 63, 37, 7);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 60, 67.50, '2013-03-01 00:00:00', 60, 46, 7);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 60, 27.20, '2012-11-30 00:00:00', 0, 49, 7);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 77, 54.63, '2013-07-25 00:00:00', 77, 31, 8);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 71, 10.00, '2013-05-30 00:00:00', 71, 38, 8);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 75, 31.25, '2012-12-24 00:00:00', 75, 60, 8);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 62, 64.13, '2013-08-17 00:00:00', 13, 4, 9);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 66, 30.60, '2013-02-23 00:00:00', 29, 7, 9);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 89, 15.30, '2013-04-15 00:00:00', 89, 30, 9);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 73, 37.80, '2013-05-24 00:00:00', 34, 44, 9);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 62, 86.69, '2012-12-10 00:00:00', 62, 12, 10);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 89, 19.97, '2012-12-31 00:00:00', 17, 36, 10);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 76, 8.55, '2012-12-10 00:00:00', 76, 3, 11);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 80, 12.50, '2013-03-14 00:00:00', 45, 5, 11);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 81, 49.50, '2013-02-05 00:00:00', 81, 37, 11);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 86, 36.23, '2013-07-06 00:00:00', 86, 42, 11);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 80, 52.25, '2013-05-16 00:00:00', 80, 37, 12);"
+"INSERT INTO stock_details ( bought_quantity, cost_per_unit, expired_date, stock_quantity, medicine_id, purchase_id) VALUES( 73, 73.20, '2013-05-20 00:00:00', 22, 41, 12);"
+""
+""
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-24 00:00:00', '2012-07-26 00:00:00', 54, 'Order from Eugene G. Watson in 2012-07-24', 0, '0', 1);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-17 00:00:00', '2012-07-17 00:00:00', 0, 'Order from Eugene G. Watson in 2012-07-17', 0, '1', 1);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-19 00:00:00', '2012-07-19 00:00:00', 0, 'Order from Calvin W. Graham in 2012-07-19', 0, '1', 2);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-22 00:00:00', '2012-07-22 00:00:00', 0, 'Order from Calvin W. Graham in 2012-07-22', 0, '1', 2);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-23 00:00:00', '2012-07-23 00:00:00', 0, 'Order from Michael L. Rafferty in 2012-07-23', 0, '1', 3);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-24 00:00:00', '2012-07-24 00:00:00', 0, 'Order from Michael L. Rafferty in 2012-07-24', 0, '1', 3);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-23 00:00:00', '2012-07-23 00:00:00', 0, 'Order from Derrick I. Mello in 2012-07-23', 0, '1', 4);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-19 00:00:00', '2012-07-19 00:00:00', 0, 'Order from Derrick I. Mello in 2012-07-19', 0, '1', 4);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-19 00:00:00', '2012-07-29 00:00:00', 578, 'Order from Derrick I. Mello in 2012-07-19', 0, '0', 4);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-23 00:00:00', '2012-07-23 00:00:00', 0, 'Order from James T. Coleman in 2012-07-23', 0, '1', 5);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-16 00:00:00', '2012-07-16 00:00:00', 0, 'Order from James T. Coleman in 2012-07-16', 0, '1', 5);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-16 00:00:00', '2012-07-16 00:00:00', 0, 'Order from James T. Coleman in 2012-07-16', 0, '1', 5);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-21 00:00:00', '2012-08-05 00:00:00', 942, 'Order from Stacey L. Gregor in 2012-07-21', 0, '0', 6);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-19 00:00:00', '2012-07-19 00:00:00', 0, 'Order from Stacey L. Gregor in 2012-07-19', 0, '1', 6);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-22 00:00:00', '2012-07-22 00:00:00', 0, 'Order from Stacey L. Gregor in 2012-07-22', 0, '1', 6);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-15 00:00:00', '2012-07-15 00:00:00', 0, 'Order from Sandra P. Glass in 2012-07-15', 0, '1', 7);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-23 00:00:00', '2012-07-23 00:00:00', 0, 'Order from Sandra P. Glass in 2012-07-23', 0, '1', 7);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-18 00:00:00', '2012-07-18 00:00:00', 0, 'Order from Crystal D. McQueen in 2012-07-18', 0, '1', 8);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-21 00:00:00', '2012-07-21 00:00:00', 0, 'Order from Crystal D. McQueen in 2012-07-21', 0, '1', 8);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-16 00:00:00', '2012-07-16 00:00:00', 0, 'Order from Crystal D. McQueen in 2012-07-16', 0, '1', 8);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-21 00:00:00', '2012-07-23 00:00:00', 82, 'Order from Sarah G. Smith in 2012-07-21', 0, '1', 9);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-18 00:00:00', '2012-07-18 00:00:00', 0, 'Order from Sarah G. Smith in 2012-07-18', 0, '1', 9);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-23 00:00:00', '2012-07-23 00:00:00', 0, 'Order from Danielle M. Nivens in 2012-07-23', 0, '1', 10);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-20 00:00:00', '2012-07-20 00:00:00', 0, 'Order from Danielle M. Nivens in 2012-07-20', 0, '1', 10);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-24 00:00:00', '2012-07-24 00:00:00', 0, 'Order from Diane S. Phillips in 2012-07-24', 0, '1', 11);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-21 00:00:00', '2012-07-21 00:00:00', 0, 'Order from Amanda D. Erdmann in 2012-07-21', 0, '1', 12);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-16 00:00:00', '2012-07-16 00:00:00', 0, 'Order from Amanda D. Erdmann in 2012-07-16', 0, '1', 12);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-19 00:00:00', '2012-07-19 00:00:00', 0, 'Order from Amanda D. Erdmann in 2012-07-19', 0, '1', 12);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-19 00:00:00', '2012-07-19 00:00:00', 0, 'Order from Susan C. Jasso in 2012-07-19', 0, '1', 13);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-17 00:00:00', '2012-07-17 00:00:00', 0, 'Order from Susan C. Jasso in 2012-07-17', 0, '1', 13);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-19 00:00:00', '2012-07-19 00:00:00', 0, 'Order from Susan C. Jasso in 2012-07-19', 0, '1', 13);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-16 00:00:00', '2012-07-16 00:00:00', 0, 'Order from Ty F. Jackson in 2012-07-16', 0, '1', 14);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-18 00:00:00', '2012-08-02 00:00:00', 865, 'Order from Ty F. Jackson in 2012-07-18', 0, '0', 14);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-16 00:00:00', '2012-07-16 00:00:00', 0, 'Order from Ty F. Jackson in 2012-07-16', 0, '1', 14);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-24 00:00:00', '2012-07-24 00:00:00', 0, 'Order from Edward S. Sikes in 2012-07-24', 0, '1', 15);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-20 00:00:00', '2012-07-20 00:00:00', 0, 'Order from Edward S. Sikes in 2012-07-20', 0, '1', 15);"
+"INSERT INTO orders ( created_at, delivered_at, distance, name, rank, status, customer_id) VALUES( '2012-07-16 00:00:00', '2012-07-16 00:00:00', 0, 'Order from Edward S. Sikes in 2012-07-16', 0, '1', 15);"
+""
+""
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 8, 1, 31);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 5, 2, 29);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 5, 3, 8);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 7, 4, 9);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 8, 5, 40);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 9, 6, 31);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 8, 7, 25);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 7, 8, 7);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 6, 9, 28);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 8, 9, 6);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 9, 10, 9);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 6, 11, 19);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 9, 12, 20);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 8, 12, 13);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 6, 13, 50);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 5, 14, 9);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 8, 15, 16);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 8, 16, 3);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 6, 17, 13);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 5, 18, 28);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 8, 19, 2);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 7, 20, 46);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 7, 21, 16);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 7, 22, 7);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 5, 23, 50);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 6, 24, 16);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 7, 25, 26);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 5, 26, 6);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 9, 27, 23);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 9, 28, 16);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 7, 29, 27);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 6, 30, 8);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 8, 31, 44);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 6, 32, 5);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 6, 32, 19);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 7, 33, 8);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 6, 34, 7);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 9, 35, 23);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 9, 36, 40);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 9, 37, 42);"
+"INSERT INTO order_details ( quantity, order_id, stock_detail_id) VALUES( 6, 37, 31);";
    
    private String tablesql = "CREATE TABLE [dbo].[distributors]("
+"	[id] [int] primary key IDENTITY(1,1) NOT NULL,"
+"	[address] [nvarchar](255) NOT NULL,"
+"	[description] [nvarchar](255) NOT NULL,"
+"	[name] [nvarchar](255) NOT NULL,"
+"	[phone] [nvarchar](255) NOT NULL,"
+"	[status] [int] NOT NULL,"
+"	[type] [nvarchar](255) NOT NULL,"
+")"
+";"
+"CREATE TABLE [dbo].[customers]("
+"	[id] [int] IDENTITY(1,1) NOT NULL,"
+"	[address] [nvarchar](255) NOT NULL,"
+"	[discount_level] [int] NOT NULL,"
+"	[name] [nvarchar](255) NOT NULL,"
+"	[phone] [nvarchar](255) NOT NULL,"
+"	[status] [int] NOT NULL,"
+")"
+";"
+"CREATE TABLE [dbo].[categories]("
+"	[id] [int] IDENTITY(1,1) NOT NULL,"
+"	[description] [nvarchar](255) NOT NULL,"
+"	[name] [nvarchar](255) NOT NULL,"
+")"
+";"
+"CREATE TABLE [dbo].[orders]("
+"	[id] [int] IDENTITY(1,1) NOT NULL,"
+"	[created_at] [datetime] NOT NULL,"
+"	[delivered_at] [datetime] NOT NULL,"
+"	[distance] [float] NOT NULL,"
+"	[name] [nvarchar](255) NOT NULL,"
+"	[rank] [int] NOT NULL,"
+"	[status] [int] NOT NULL,"
+"	[customer_id] [int] NOT NULL,"
+")"
+";"
+"CREATE TABLE [dbo].[medicines]("
+"	[id] [int] IDENTITY(1,1) NOT NULL,"
+"	[code] [nvarchar](255) NOT NULL,"
+"	[description] [nvarchar](255) NOT NULL,"
+"	[name] [nvarchar](255) NOT NULL,"
+"	[price] [numeric](19, 2) NOT NULL,"
+"	[status] [int] NOT NULL,"
+"	[category_id] [int] NOT NULL,"
+")"
+";"
+"CREATE TABLE [dbo].[purchases]("
+"	[id] [int] IDENTITY(1,1) NOT NULL,"
+"	[name] [nvarchar](255) NOT NULL,"
+"	[status] [int] NOT NULL,"
+"	[time] [datetime] NOT NULL,"
+"	[distributor_id] [int] NOT NULL,"
+")"
+";"
+"CREATE TABLE [dbo].[stock_details]("
+"	[id] [int] IDENTITY(1,1) NOT NULL,"
+"	[bought_quantity] [int] NOT NULL,"
+"	[cost_per_unit] [numeric](19, 2) NOT NULL,"
+"	[expired_date] [datetime] NOT NULL,"
+"	[stock_quantity] [int] NOT NULL,"
+"	[medicine_id] [int] NOT NULL,"
+"	[purchase_id] [int] NOT NULL,"
+");"
+"CREATE TABLE [dbo].[order_details]("
+"	[id] [int] IDENTITY(1,1) NOT NULL,"
+"	[quantity] [int] NOT NULL,"
+"	[order_id] [int] NOT NULL,"
+"	[stock_detail_id] [int] NOT NULL,"
+");"
+"ALTER TABLE [dbo].[customers] ADD  CONSTRAINT [DF_customers_status]  DEFAULT ((0)) FOR [status];"
+"ALTER TABLE [dbo].[distributors] ADD  CONSTRAINT [DF_distributors_status]  DEFAULT ((0)) FOR [status];"
+"ALTER TABLE [dbo].[medicines] ADD  CONSTRAINT [DF_medicines_code]  DEFAULT ((0)) FOR [code];"
+"ALTER TABLE [dbo].[medicines] ADD  CONSTRAINT [DF_medicines_status]  DEFAULT ((0)) FOR [status];"
+"ALTER TABLE [dbo].[purchases] ADD  CONSTRAINT [DF_purchases_status]  DEFAULT ((0)) FOR [status];"
+"ALTER TABLE [dbo].[medicines]  ADD  CONSTRAINT [FK7FBA717998403770] FOREIGN KEY([category_id]) REFERENCES [dbo].[categories] ([id]);"
+"ALTER TABLE [dbo].[order_details]  ADD  CONSTRAINT [FK521CF25115AA13E9] FOREIGN KEY([order_id]) REFERENCES [dbo].[orders] ([id]);"
+"ALTER TABLE [dbo].[order_details]  ADD  CONSTRAINT [FK521CF2513E109784] FOREIGN KEY([stock_detail_id]) REFERENCES [dbo].[stock_details] ([id]);"
+"ALTER TABLE [dbo].[purchases]  ADD  CONSTRAINT [FK95379B924F613137] FOREIGN KEY([distributor_id]) REFERENCES [dbo].[distributors] ([id]);"
+"ALTER TABLE [dbo].[stock_details]  ADD  CONSTRAINT [FK8AEE1A19785C0C53] FOREIGN KEY([purchase_id]) REFERENCES [dbo].[purchases] ([id]);"
+"ALTER TABLE [dbo].[stock_details]  ADD  CONSTRAINT [FK8AEE1A19B803DA61] FOREIGN KEY([medicine_id]) REFERENCES [dbo].[medicines] ([id]);";
    private String catedatasql = "INSERT INTO categories ( description, name) VALUES( '', 'urinary problems');"
+"INSERT INTO categories ( description, name) VALUES( '', 'adhd');"
+"INSERT INTO categories ( description, name) VALUES( '', 'pregnancy');"
+"INSERT INTO categories ( description, name) VALUES( '', 'medicines');"
+"INSERT INTO categories ( description, name) VALUES( '', 'smoking cessation');";

    public Config getConfig() {
        return config;
    }

    public void setConfig(Config config) {
        this.config = config;
    }

    public order_tab getOrdertab() {
        return ordertab;
    }

    public void setOrdertab(order_tab ordertab) {
        this.ordertab = ordertab;
    }

    public JButton getjButton1() {
        return jButton1;
    }

    public void setjButton1(JButton jButton1) {
        this.jButton1 = jButton1;
    }
    
    /**
     * Creates new form Install
     */
    public Install() {
        initComponents();
        jTextField1.setText("localhost");
        jTextField2.setText("1433");
        jTextField3.setText("demo");
        jTextField4.setText("sa");
        jTextField5.setText("1234567");
        jCheckBox1.setSelected(true);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jTextField2 = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jTextField3 = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jTextField4 = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jTextField5 = new javax.swing.JTextField();
        jButton2 = new javax.swing.JButton();
        jCheckBox1 = new javax.swing.JCheckBox();
        jButton1 = new javax.swing.JButton();
        jLabel6 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setBounds(new java.awt.Rectangle(400, 180, 400, 200));
        setResizable(false);

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel1.setText("Server");

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel2.setText("Port");

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel3.setText("Database");

        jLabel4.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel4.setText("Username");

        jLabel5.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel5.setText("Password");

        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/ok.png"))); // NOI18N
        jButton2.setText("Install");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jCheckBox1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jCheckBox1.setText("        Use sample database");
        jCheckBox1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox1ActionPerformed(evt);
            }
        });

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Delete.png"))); // NOI18N
        jButton1.setText("Exit");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(37, 37, 37)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel1)
                            .addComponent(jLabel2))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(jCheckBox1)
                    .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 18, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel4, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(43, 43, 43))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3)
                    .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4)
                    .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jCheckBox1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton2)
                    .addComponent(jButton1))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jLabel6.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
        jLabel6.setText("Database Config");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(39, 39, 39)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(53, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel6)
                .addGap(185, 185, 185))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel6)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 23, Short.MAX_VALUE)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
    public String getConnectionString() throws Exception {
        StringBuilder sb = new StringBuilder();
        sb.append("jdbc:sqlserver://");
        sb.append(jTextField1.getText());
        sb.append(":");
        sb.append(jTextField2.getText());
        
        sb.append(";databaseName=");
        sb.append(jTextField3.getText());
        
        sb.append(";user=");
        sb.append(jTextField4.getText());
        
        sb.append(";password=");
        sb.append(jTextField5.getText());
        
        return sb.toString();        
    }
    
    public boolean connect() {
                
        try {
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            con = DriverManager.getConnection(getConnectionString());
        } catch (Exception ex) {
            return false;
        }
        
        return true;
    }
    public void exec(String sql){
        try {
            Statement query = con.createStatement();
            query.execute(sql);
        } catch (SQLException ex) {
            System.out.println(ex.getMessage());
        }
    }
    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        String server = jTextField1.getText();
        String port = jTextField2.getText();
        String database = jTextField3.getText();
        String username = jTextField4.getText();
        String password = jTextField5.getText();
        boolean sample = jCheckBox1.isSelected();
        
        String oldDB = "";
        if(config!=null) oldDB = config.getDatabase();
        config = new Config(server, port, username, password, database, sample);
        
        if(!connect()){
            JOptionPane.showMessageDialog(null, "Config is fail!", "Error", JOptionPane.ERROR_MESSAGE);
            return;
        }
        
        configUpdate();
        configStatusUpdate();
        
        if(oldDB.equals("") || !config.getDatabase().equals(oldDB)){
            
            if(sample){
                exec(tablesql);
                exec(datasql);
            }
            else{
                exec(catedatasql);
            }
        }
        
        JOptionPane.showMessageDialog(null, "Config is successful!", "Message", JOptionPane.INFORMATION_MESSAGE);
        this.setVisible(false);
        if(ordertab==null){
            ordertab = new order_tab(this);
            ordertab.setVisible(true);
        }
        else{
            ordertab.dispose();
            ordertab = new order_tab(this);
            ordertab.setVisible(true);
        }
        

    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        if(jButton1.getText().equals("Cancel")){
            this.setVisible(false);
        }
        else{
            System.exit(0);
        }
        
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jCheckBox1ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Metal".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Install.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Install.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Install.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Install.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                String val = "";
                try {
                    FileReader fr = new FileReader("IsConfig.txt");
                    BufferedReader br = new BufferedReader(fr);
                    val = br.readLine().trim();
                    
                    br.close();
                    fr.close();
                    
                } catch (Exception err) {
                    err.printStackTrace();
                }
                if (val.equals("false")) {
                    new Install().setVisible(true);

                } else {
                    Install install = new Install();
                    install.setOrdertab(new order_tab(install));
                    install.getOrdertab().setVisible(true);
                }
            }
        });
    }

    public void configUpdate() {
        String filepath = "hibernate.cfg.xml";

        try {
            BufferedReader br = new BufferedReader(new FileReader(new File(filepath)));
            String strLine;
            ArrayList<String> content = new ArrayList<String>();
            int i = 1;
            while ((strLine = br.readLine()) != null) {
                System.out.println(strLine);

                if (i == 6) {
                    content.add("\t\t<property name=\"hibernate.connection.url\">jdbc:sqlserver://" 
                            + config.getServer() 
                            + ":" + config.getPort() 
                            + ";databaseName=" + config.getDatabase() 
                            + "</property>");
                } else if (i == 7) {
                    content.add("\t\t<property name=\"hibernate.connection.username\">"+config.getUsername()+"</property>");
                } else if (i == 8) {
                    content.add("\t\t<property name=\"hibernate.connection.password\">"+config.getPassword()+"</property>");
                } else {
                    content.add(strLine);
                }
                i++;
            }
            br.close();
            File f = new File(filepath);
            f.delete();
            f.createNewFile();
            BufferedWriter bw = new BufferedWriter(new FileWriter(f));
            for (String string : content) {
                bw.write(string);
                bw.newLine();
            }
            bw.close();

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void configStatusUpdate() {
        try {
            FileWriter fw = new FileWriter("IsConfig.txt");
            BufferedWriter bw = new BufferedWriter(fw);
            bw.write("true");
            bw.close();
            fw.close();

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JCheckBox jCheckBox1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField jTextField4;
    private javax.swing.JTextField jTextField5;
    // End of variables declaration//GEN-END:variables
}
class Config {

    String server, port, username, password, database;
    boolean isUseSample;

    public String getDatabase() {
        return database;
    }

    public void setDatabase(String database) {
        this.database = database;
    }

    public boolean isIsUseSample() {
        return isUseSample;
    }

    public void setIsUseSample(boolean isUseSample) {
        this.isUseSample = isUseSample;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPort() {
        return port;
    }

    public void setPort(String port) {
        this.port = port;
    }

    public String getServer() {
        return server;
    }

    public void setServer(String server) {
        this.server = server;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Config() {
    }

    public Config(String server, String port, String username, String password, String database, boolean isUseSample) {
        this.server = server;
        this.port = port;
        this.username = username;
        this.password = password;
        this.database = database;
        this.isUseSample = isUseSample;
    }
}